<div class="home-container">	
	<div class="home-content">
		<div class="validation-errors" id="validationErrors" style="display:none; width: 300px;"></div>
		<?php
			Includes::IncludeFile( Includes::$FORM );
		
			echo( form_open(base_url() . 'cmb/member/reset_password_email_process/'.$urlKey , array('id' => 'ResetPasswordEmailForm') ) );				
				Form::OpenFormItem('New Password:', 150);
					echo( form_password(array('name'=>'newpassword','id'=>'newpassword','style'=>'width: 150px;', 'onkeyup'=>'loginKeyUp(event);')) );
				Form::CloseFormItem();
				Form::OpenFormItem('Re-Type Password:', 150);
					echo( form_password(array('name'=>'newpassword_confirm','id'=>'newpassword_confirm','style'=>'width: 150px;', 'onkeyup'=>'loginKeyUp(event);')) );
				Form::CloseFormItem();
			echo( form_close() );
		?>

		<div>
			<a href="javascript: validate();"><img src="<?php echo( base_url() );?>assets/images/buttons/submit_off.gif" border="0" onmouseover="this.src = '<?php echo( base_url() );?>assets/images/buttons/submit_over.gif';" onmousedown="this.src = '<?php echo( base_url() );?>assets/images/buttons/submit_on.gif';" onmouseup="this.src = '<?php echo( base_url() );?>assets/images/buttons/submit_off.gif';" onmouseout="this.src = '<?php echo( base_url() );?>assets/images/buttons/submit_off.gif';" /></a>
		</div>
		<div>
		</div>
	</div>
	<div class="clear"></div>
</div>


<script type="text/javascript">
	function loginKeyUp(event)
	{
		if( event.keyCode == 13 )
		{
			validate();
		}
	}
	
	function validate()
	{
		new Ajax.Request(baseUrl + 'validation/login_validation/validate_reset_password/', 
		{
			method:'post',
			parameters: Form.serialize( $('ResetPasswordEmailForm') ),
		  	onSuccess: function(response)
			{
				var result = response.responseText;
				
				if( result == 'VALIDATION_SUCCESS' )
				{
					$('ResetPasswordEmailForm').submit();
				}
				else
				{
					$('validationErrors').innerHTML = result;
					$('validationErrors').show();
					Effect.ScrollTo('validationErrors', { duration:'0.2', offset:-20 });
				}
			},
			onFailure: function(response){}
		});
	}
</script>